home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
Moscow ML 1.31
/
source code
/
mosml
/
src
/
test
/
test3.sml
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1996-07-03
|
340 b
|
17 lines
|
[
TEXT/R*ch
]
datatype 'a Tree =
Lf
| Br of 'a * 'a Tree * 'a Tree
;
val t1 = Br(2, Br(1, Lf, Lf), Br(3, Lf, Lf));
fun foldTree f u Lf = u
| foldTree f u (Br(a, left, right)) =
f a (foldTree f u left) (foldTree f u right)
;
fun revBranch a left right = Br(a, right, left);
val reflect = foldTree revBranch Lf;
val refl_t1 = reflect t1;